/*
 ============================================================================
 Name		: YuebaoMagazineAppView.h
 Author	  : 
 Copyright   :
 Description : Declares view class for application.
 ============================================================================
 */

#ifndef __YUEBAOMAGAZINEAPPVIEW_h__
#define __YUEBAOMAGAZINEAPPVIEW_h__

// INCLUDES
#include <coecntrl.h>
#include <aknmessagequerydialog.h>
class YuebaoFramework;
// CLASS DECLARATION
class CYuebaoMagazineAppView : public CCoeControl, public MCoeForegroundObserver
{

public:
    // New methods

    static CYuebaoMagazineAppView *NewL( const TRect & aRect );
    static CYuebaoMagazineAppView *NewLC( const TRect & aRect );
    virtual ~ CYuebaoMagazineAppView( );

public:
    // Functions from base classes

    void Draw( const TRect & aRect ) const;

    void SetBackground( ) const;
    virtual void SizeChanged( );

public:
    void HandlePointerEventL( const TPointerEvent& aPointerEvent );
public:
    CEikEdwin* NewMultilineEdwin( TInt aMaxLength, TInt aLineWidth, TInt aLines );
    void DestoryEdwin( CEikEdwin* pEikEdwinToBeDestory );
    void DestoryEdwin( CEikSecretEditor* pEikEdwinToBeDestory );
    void SetFontHeight( CEikEdwin* pEditor, int nFontHeightInPixel );
    CEikEdwin * NewEdwin( TInt aRes = 0 );
    void SetEdwinFontSize( CEikEdwin * aEdwin, int aFontSize );
    CEikSecretEditor *NewSecretEditor( );

    void AddControl( CCoeControl * aControl );
    TBool DeleteControl( CCoeControl * aControl );
    void DeleteAllControls( );
    void SetEdwinStyle( CEikEdwin * edwin );
    void DisVisableAllEdit( );

    virtual TInt CountComponentControls( ) const;
    virtual CCoeControl *ComponentControl( TInt aIndex ) const;

private:
    // Constructors

    void ConstructL( const TRect & aRect );
    void HandleGainingForeground( );
    void HandleLosingForeground( );
    CYuebaoMagazineAppView( );

private:
    YuebaoFramework * iFramework;
    RPointerArray< CCoeControl > iCtrlArray;

public:
    YuebaoFramework * Framework( );
    void HideAllEditor( );

public:
    TBool iIsEngineInited;
    TBool iIsHasBackground;
};

#endif // __YUEBAOMAGAZINEAPPVIEW_h__
// End of File
